export default {
  name: [
    { required: true, message: "活动名称不能为空", trigger: "blur" },
    { min: 1, max: 15, message: "长度在 1 到 15 个字符", trigger: "blur" }
  ],

  time: [{ required: true, message: "活动时间不能为空", trigger: "blur" }],
  group_ids: [{ required: true, message: "请选择用户分组", trigger: "blur" }],
  price: [
    { required: true, message: "活动价格不能为空", trigger: "blur" },
    {
      pattern: /([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])/,
      message: "请输入大于零的数字",
      trigger: "change"
    }
  ],
  num_limit: [
    { required: true, message: "用户限购不能为空", trigger: "blur" },
    {
      pattern: /([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])/,
      message: "请输入大于零的数字",
      trigger: "change"
    }
  ],
  minimum: [
    { required: true, message: "起订量不能为空", trigger: "blur" },
    {
      // pattern: /^(\d+\.?)?\d{0,2}$/,
      pattern: /([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])/,
      message: "请输入大于零的数字",
      trigger: "change"
    }
  ],
  inventory: [
    { required: true, message: "活动库存不能为空", trigger: "blur" },
    {
      pattern: /([1-9][0-9]*(\.[0-9]*[1-9])?|0\.[0-9]*[1-9])/,
      message: "请输入大于零的数字",
      trigger: "change"
    }
  ]

  // /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/ 身份证号码
  // /^[0-9]*[1-9][0-9]*$/ 整数
  // /^(\d+\.?)?\d{0,2}$/ 整数和小数
  // /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/ 手机
  // /^([a-zA-Z0-9]+[-_\.]?)+@[a-zA-Z0-9]+\.[a-z]+$/ 邮箱
};
